#ifndef UML_APPLICATION_H
#define UML_APPLICATION_H

#include <DApplication>

class UmlApplicationPrivate;

DWIDGET_USE_NAMESPACE

#define UmlApp UmlApplication::instance()

class UmlApplication : public DApplication
{
    Q_OBJECT

public:
    UmlApplication(int &argc, char **argv);
    ~UmlApplication() Q_DECL_OVERRIDE;

    static UmlApplication *instance();

    // 获取主题的保存状态
    bool isThemeAutoSaved() const;

    // 获取日志所在位置
    QString loggerPath() const;

public Q_SLOTS:
    // 设置主题记忆
    void setThemeAutoSaved(bool saved);

    // 添加日志
    void registerLogger(const QString &path = "");

private:
    Q_DISABLE_COPY(UmlApplication)
    Q_DECLARE_PRIVATE(UmlApplication)

    static UmlApplication *m_self;
    UmlApplicationPrivate *d_ptr = Q_NULLPTR;
};

#endif // UML_APPLICATION_H
